<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:d="http://www.mydata.com/xmlns/data">
    <head>
        <title>Demo of date formatting using XPath concat and substring</title>
        <style type="text/css">
    @namespace xf url('http://www.w3.org/2002/xforms');
    
    .hidden .xf-value {
       display:none;
    }
    </style>
    </head>
    
    <body>
       <xf:model>
			<xf:instance xmlns="">
				<MyModel>
					<MyDate>2006-09-12</MyDate>
				</MyModel>
			</xf:instance>
			<xf:bind nodeset="/MyModel/MyDate" type="xs:date" />
		</xf:model>


        <xf:input class="hidden" ref="/MyModel/MyDate" incremental="true">
            <xf:label>Select Date: </xf:label>
        </xf:input>
        <!-- get the month (two characters wide starting at character number 6), then the day then the year -->
        <xf:output
            value="concat(substring(/MyModel/MyDate,6,2),'/',substring(/MyModel/MyDate,9,2),'/',substring(/MyModel/MyDate,1,4))"
        />
    </body>
</html>